{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE LambdaCase #-}
module Telegram.Bot.API.Forum where
import Data.Aeson (ToJSON (..))
import Data.Proxy
import Data.Text (Text)
import GHC.Generics (Generic)
import Servant.API
import Servant.Client hiding (Response)
import Telegram.Bot.API.Internal.Utils
import Telegram.Bot.API.MakingRequests (Response)
import Telegram.Bot.API.Types
type GetForumTopicIconStickers
= "getForumTopicIconStickers"
:> Post '[JSON] (Response [Sticker])
getForumTopicIconStickers :: ClientM (Response [Sticker])
getForumTopicIconStickers :: ClientM (Response [Sticker])
getForumTopicIconStickers = forall api.
HasClient ClientM api =>
Proxy api -> Client ClientM api
client (forall {k} (t :: k). Proxy t
Proxy @GetForumTopicIconStickers)
data CreateForumTopicRequest = CreateForumTopicRequest
{ CreateForumTopicRequest -> SomeChatId
createForumTopicRequestChatId :: SomeChatId
, CreateForumTopicRequest -> Text
createForumTopicName :: Text
, CreateForumTopicRequest -> Maybe Integer
createForumTopicIconColor :: Maybe Integer
, CreateForumTopicRequest -> Maybe Text
createForumTopicIconCustomEmojiId :: Maybe Text
}
deriving forall x. Rep CreateForumTopicRequest x -> CreateForumTopicRequest
forall x. CreateForumTopicRequest -> Rep CreateForumTopicRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateForumTopicRequest x -> CreateForumTopicRequest
$cfrom :: forall x. CreateForumTopicRequest -> Rep CreateForumTopicRequest x
Generic
instance ToJSON CreateForumTopicRequest where toJSON :: CreateForumTopicRequest -> Value
toJSON = forall a (d :: Meta) (f :: * -> *).
(Generic a, GToJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
a -> Value
gtoJSON
type CreateForumTopic
= "createForumTopic"
:> ReqBody '[JSON] CreateForumTopicRequest
:> Post '[JSON] (Response ForumTopic)
createForumTopic :: CreateForumTopicRequest -> ClientM (Response ForumTopic)
createForumTopic :: CreateForumTopicRequest -> ClientM (Response ForumTopic)
createForumTopic = forall api.
HasClient ClientM api =>
Proxy api -> Client ClientM api
client (forall {k} (t :: k). Proxy t
Proxy @CreateForumTopic)
data EditForumTopicRequest = EditForumTopicRequest
{ EditForumTopicRequest -> SomeChatId
editForumTopicChatId :: SomeChatId
, EditForumTopicRequest -> MessageThreadId
editForumTopicMessageThreadId :: MessageThreadId
, EditForumTopicRequest -> Maybe Text
editForumTopicName :: Maybe Text
, EditForumTopicRequest -> Maybe Text
editForumTopicIconCustomEmojiId :: Maybe Text
}
deriving forall x. Rep EditForumTopicRequest x -> EditForumTopicRequest
forall x. EditForumTopicRequest -> Rep EditForumTopicRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EditForumTopicRequest x -> EditForumTopicRequest
$cfrom :: forall x. EditForumTopicRequest -> Rep EditForumTopicRequest x
Generic
instance ToJSON EditForumTopicRequest where toJSON :: EditForumTopicRequest -> Value
toJSON = forall a (d :: Meta) (f :: * -> *).
(Generic a, GToJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
a -> Value
gtoJSON
type EditForumTopic
= "editForumTopic"
:> ReqBody '[JSON] EditForumTopicRequest
:> Post '[JSON] (Response Bool)
editForumTopic :: EditForumTopicRequest -> ClientM (Response Bool)
editForumTopic :: EditForumTopicRequest -> ClientM (Response Bool)
editForumTopic = forall api.
HasClient ClientM api =>
Proxy api -> Client ClientM api
client (forall {k} (t :: k). Proxy t
Proxy @EditForumTopic)
data CloseForumTopicRequest = CloseForumTopicRequest
{ CloseForumTopicRequest -> SomeChatId
closeForumTopicChatId :: SomeChatId
, CloseForumTopicRequest -> MessageThreadId
closeForumTopicMessageThreadId :: MessageThreadId
}
deriving forall x. Rep CloseForumTopicRequest x -> CloseForumTopicRequest
forall x. CloseForumTopicRequest -> Rep CloseForumTopicRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CloseForumTopicRequest x -> CloseForumTopicRequest
$cfrom :: forall x. CloseForumTopicRequest -> Rep CloseForumTopicRequest x
Generic
instance ToJSON CloseForumTopicRequest where toJSON :: CloseForumTopicRequest -> Value
toJSON = forall a (d :: Meta) (f :: * -> *).
(Generic a, GToJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
a -> Value
gtoJSON
type CloseForumTopic
= "closeForumTopic"
:> ReqBody '[JSON] CloseForumTopicRequest
:> Post '[JSON] (Response Bool)
closeForumTopic :: CloseForumTopicRequest -> ClientM (Response Bool)
closeForumTopic :: CloseForumTopicRequest -> ClientM (Response Bool)
closeForumTopic = forall api.
HasClient ClientM api =>
Proxy api -> Client ClientM api
client (forall {k} (t :: k). Proxy t
Proxy @CloseForumTopic)
data ReopenForumTopicRequest = ReopenForumTopicRequest
{ ReopenForumTopicRequest -> SomeChatId
reopenForumTopicChatId :: SomeChatId
, ReopenForumTopicRequest -> MessageThreadId
reopenForumTopicMessageThreadId :: MessageThreadId
}
deriving forall x. Rep ReopenForumTopicRequest x -> ReopenForumTopicRequest
forall x. ReopenForumTopicRequest -> Rep ReopenForumTopicRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ReopenForumTopicRequest x -> ReopenForumTopicRequest
$cfrom :: forall x. ReopenForumTopicRequest -> Rep ReopenForumTopicRequest x
Generic
instance ToJSON ReopenForumTopicRequest where toJSON :: ReopenForumTopicRequest -> Value
toJSON = forall a (d :: Meta) (f :: * -> *).
(Generic a, GToJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
a -> Value
gtoJSON
type ReopenForumTopic
= "reopenForumTopic"
:> ReqBody '[JSON] ReopenForumTopicRequest
:> Post '[JSON] (Response Bool)
reopenForumTopic :: ReopenForumTopicRequest -> ClientM (Response Bool)
reopenForumTopic :: ReopenForumTopicRequest -> ClientM (Response Bool)
reopenForumTopic = forall api.
HasClient ClientM api =>
Proxy api -> Client ClientM api
client (forall {k} (t :: k). Proxy t
Proxy @ReopenForumTopic)
data DeleteForumTopicRequest = DeleteForumTopicRequest
{ DeleteForumTopicRequest -> SomeChatId
deleteForumTopicChatId :: SomeChatId
, DeleteForumTopicRequest -> MessageThreadId
deleteForumTopicMessageThreadId :: MessageThreadId
}
deriving forall x. Rep DeleteForumTopicRequest x -> DeleteForumTopicRequest
forall x. DeleteForumTopicRequest -> Rep DeleteForumTopicRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteForumTopicRequest x -> DeleteForumTopicRequest
$cfrom :: forall x. DeleteForumTopicRequest -> Rep DeleteForumTopicRequest x
Generic
instance ToJSON DeleteForumTopicRequest where toJSON :: DeleteForumTopicRequest -> Value
toJSON = forall a (d :: Meta) (f :: * -> *).
(Generic a, GToJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
a -> Value
gtoJSON
type DeleteForumTopic
= "deleteForumTopic"
:> ReqBody '[JSON] DeleteForumTopicRequest
:> Post '[JSON] (Response Bool)
deleteForumTopic :: DeleteForumTopicRequest -> ClientM (Response Bool)
deleteForumTopic :: DeleteForumTopicRequest -> ClientM (Response Bool)
deleteForumTopic = forall api.
HasClient ClientM api =>
Proxy api -> Client ClientM api
client (forall {k} (t :: k). Proxy t
Proxy @DeleteForumTopic)
data UnpinAllForumTopicMessagesRequest = UnpinAllForumTopicMessagesRequest
{ UnpinAllForumTopicMessagesRequest -> SomeChatId
unpinAllForumTopicMessagesChatId :: SomeChatId
, UnpinAllForumTopicMessagesRequest -> MessageThreadId
unpinAllForumTopicMessagesMessageThreadId :: MessageThreadId
}
deriving forall x.
Rep UnpinAllForumTopicMessagesRequest x
-> UnpinAllForumTopicMessagesRequest
forall x.
UnpinAllForumTopicMessagesRequest
-> Rep UnpinAllForumTopicMessagesRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UnpinAllForumTopicMessagesRequest x
-> UnpinAllForumTopicMessagesRequest
$cfrom :: forall x.
UnpinAllForumTopicMessagesRequest
-> Rep UnpinAllForumTopicMessagesRequest x
Generic
instance ToJSON UnpinAllForumTopicMessagesRequest where toJSON :: UnpinAllForumTopicMessagesRequest -> Value
toJSON = forall a (d :: Meta) (f :: * -> *).
(Generic a, GToJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
a -> Value
gtoJSON
type UnpinAllForumTopicMessages
= "unpinAllForumTopicMessages"
:> ReqBody '[JSON] UnpinAllForumTopicMessagesRequest
:> Post '[JSON] (Response Bool)
unpinAllForumTopicMessages :: UnpinAllForumTopicMessagesRequest -> ClientM (Response Bool)
unpinAllForumTopicMessages :: UnpinAllForumTopicMessagesRequest -> ClientM (Response Bool)
unpinAllForumTopicMessages = forall api.
HasClient ClientM api =>
Proxy api -> Client ClientM api
client (forall {k} (t :: k). Proxy t
Proxy @UnpinAllForumTopicMessages)
data EditGeneralForumTopicRequest = EditGeneralForumTopicRequest
{ EditGeneralForumTopicRequest -> SomeChatId
editGeneralForumTopicChatId :: SomeChatId
, EditGeneralForumTopicRequest -> Text
editGeneralForumTopicName :: Text
}
deriving forall x.
Rep EditGeneralForumTopicRequest x -> EditGeneralForumTopicRequest
forall x.
EditGeneralForumTopicRequest -> Rep EditGeneralForumTopicRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep EditGeneralForumTopicRequest x -> EditGeneralForumTopicRequest
$cfrom :: forall x.
EditGeneralForumTopicRequest -> Rep EditGeneralForumTopicRequest x
Generic
instance ToJSON EditGeneralForumTopicRequest where toJSON :: EditGeneralForumTopicRequest -> Value
toJSON = forall a (d :: Meta) (f :: * -> *).
(Generic a, GToJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
a -> Value
gtoJSON
type EditGeneralForumTopic
= "editGeneralForumTopic"
:> ReqBody '[JSON] EditGeneralForumTopicRequest
:> Post '[JSON] (Response Bool)
editGeneralForumTopic :: EditGeneralForumTopicRequest -> ClientM (Response Bool)
editGeneralForumTopic :: EditGeneralForumTopicRequest -> ClientM (Response Bool)
editGeneralForumTopic = forall api.
HasClient ClientM api =>
Proxy api -> Client ClientM api
client (forall {k} (t :: k). Proxy t
Proxy @EditGeneralForumTopic)
data CloseGeneralForumTopicRequest = CloseGeneralForumTopicRequest
{ CloseGeneralForumTopicRequest -> SomeChatId
closeGeneralForumTopicChatId :: SomeChatId
}
deriving forall x.
Rep CloseGeneralForumTopicRequest x
-> CloseGeneralForumTopicRequest
forall x.
CloseGeneralForumTopicRequest
-> Rep CloseGeneralForumTopicRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CloseGeneralForumTopicRequest x
-> CloseGeneralForumTopicRequest
$cfrom :: forall x.
CloseGeneralForumTopicRequest
-> Rep CloseGeneralForumTopicRequest x
Generic
instance ToJSON CloseGeneralForumTopicRequest where toJSON :: CloseGeneralForumTopicRequest -> Value
toJSON = forall a (d :: Meta) (f :: * -> *).
(Generic a, GToJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
a -> Value
gtoJSON
type CloseGeneralForumTopic
= "closeGeneralForumTopic"
:> ReqBody '[JSON] CloseGeneralForumTopicRequest
:> Post '[JSON] (Response Bool)
closeGeneralForumTopic :: CloseGeneralForumTopicRequest -> ClientM (Response Bool)
closeGeneralForumTopic :: CloseGeneralForumTopicRequest -> ClientM (Response Bool)
closeGeneralForumTopic = forall api.
HasClient ClientM api =>
Proxy api -> Client ClientM api
client (forall {k} (t :: k). Proxy t
Proxy @CloseGeneralForumTopic)
data ReopenGeneralForumTopicRequest = ReopenGeneralForumTopicRequest
{ ReopenGeneralForumTopicRequest -> SomeChatId
reopenGeneralForumTopicRequestChatId :: SomeChatId
}
deriving forall x.
Rep ReopenGeneralForumTopicRequest x
-> ReopenGeneralForumTopicRequest
forall x.
ReopenGeneralForumTopicRequest
-> Rep ReopenGeneralForumTopicRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ReopenGeneralForumTopicRequest x
-> ReopenGeneralForumTopicRequest
$cfrom :: forall x.
ReopenGeneralForumTopicRequest
-> Rep ReopenGeneralForumTopicRequest x
Generic
instance ToJSON ReopenGeneralForumTopicRequest where toJSON :: ReopenGeneralForumTopicRequest -> Value
toJSON = forall a (d :: Meta) (f :: * -> *).
(Generic a, GToJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
a -> Value
gtoJSON
type ReopenGeneralForumTopic
= "reopenGeneralForumTopic"
:> ReqBody '[JSON] ReopenGeneralForumTopicRequest
:> Post '[JSON] (Response Bool)
reopenGeneralForumTopic :: ReopenGeneralForumTopicRequest -> ClientM (Response Bool)
reopenGeneralForumTopic :: ReopenGeneralForumTopicRequest -> ClientM (Response Bool)
reopenGeneralForumTopic = forall api.
HasClient ClientM api =>
Proxy api -> Client ClientM api
client (forall {k} (t :: k). Proxy t
Proxy @ReopenGeneralForumTopic)
data HideGeneralForumTopicRequest = HideGeneralForumTopicRequest
{ HideGeneralForumTopicRequest -> SomeChatId
hideGeneralForumTopicChatId :: SomeChatId
}
deriving forall x.
Rep HideGeneralForumTopicRequest x -> HideGeneralForumTopicRequest
forall x.
HideGeneralForumTopicRequest -> Rep HideGeneralForumTopicRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep HideGeneralForumTopicRequest x -> HideGeneralForumTopicRequest
$cfrom :: forall x.
HideGeneralForumTopicRequest -> Rep HideGeneralForumTopicRequest x
Generic
instance ToJSON HideGeneralForumTopicRequest where toJSON :: HideGeneralForumTopicRequest -> Value
toJSON = forall a (d :: Meta) (f :: * -> *).
(Generic a, GToJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
a -> Value
gtoJSON
type HideGeneralForumTopic
= "hideGeneralForumTopic"
:> ReqBody '[JSON] HideGeneralForumTopicRequest
:> Post '[JSON] (Response Bool)
hideGeneralForumTopic :: HideGeneralForumTopicRequest -> ClientM (Response Bool)
hideGeneralForumTopic :: HideGeneralForumTopicRequest -> ClientM (Response Bool)
hideGeneralForumTopic = forall api.
HasClient ClientM api =>
Proxy api -> Client ClientM api
client (forall {k} (t :: k). Proxy t
Proxy @HideGeneralForumTopic)
data UnhideGeneralForumTopicRequest = UnhideGeneralForumTopicRequest
{ UnhideGeneralForumTopicRequest -> SomeChatId
unhideGeneralForumTopicChatId :: SomeChatId
}
deriving forall x.
Rep UnhideGeneralForumTopicRequest x
-> UnhideGeneralForumTopicRequest
forall x.
UnhideGeneralForumTopicRequest
-> Rep UnhideGeneralForumTopicRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UnhideGeneralForumTopicRequest x
-> UnhideGeneralForumTopicRequest
$cfrom :: forall x.
UnhideGeneralForumTopicRequest
-> Rep UnhideGeneralForumTopicRequest x
Generic
instance ToJSON UnhideGeneralForumTopicRequest where toJSON :: UnhideGeneralForumTopicRequest -> Value
toJSON = forall a (d :: Meta) (f :: * -> *).
(Generic a, GToJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
a -> Value
gtoJSON
type UnhideGeneralForumTopic
= "unhideGeneralForumTopic"
:> ReqBody '[JSON] UnhideGeneralForumTopicRequest
:> Post '[JSON] (Response Bool)
unhideGeneralForumTopic :: UnhideGeneralForumTopicRequest -> ClientM (Response Bool)
unhideGeneralForumTopic :: UnhideGeneralForumTopicRequest -> ClientM (Response Bool)
unhideGeneralForumTopic = forall api.
HasClient ClientM api =>
Proxy api -> Client ClientM api
client (forall {k} (t :: k). Proxy t
Proxy @UnhideGeneralForumTopic)