{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeOperators #-}
module Telegram.Bot.API.Methods.EditChatInviteLink 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.Types
import Telegram.Bot.API.Internal.TH
data EditChatInviteLinkRequest = EditChatInviteLinkRequest
{ EditChatInviteLinkRequest -> SomeChatId
editChatInviteLinkChatId :: SomeChatId
, EditChatInviteLinkRequest -> Text
editChatInviteLinkInviteLink :: Text
, EditChatInviteLinkRequest -> Maybe Text
editChatInviteLinkName :: Maybe Text
, EditChatInviteLinkRequest -> Maybe Integer
editChatInviteLinkExpireDate :: Maybe Integer
, EditChatInviteLinkRequest -> Maybe Int
editChatInviteLinkMemberLimit :: Maybe Int
, EditChatInviteLinkRequest -> Maybe Bool
editChatInviteLinkCreatesJoinRequest :: Maybe Bool
}
deriving forall x.
Rep EditChatInviteLinkRequest x -> EditChatInviteLinkRequest
forall x.
EditChatInviteLinkRequest -> Rep EditChatInviteLinkRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep EditChatInviteLinkRequest x -> EditChatInviteLinkRequest
$cfrom :: forall x.
EditChatInviteLinkRequest -> Rep EditChatInviteLinkRequest x
Generic
instance ToJSON EditChatInviteLinkRequest where toJSON :: EditChatInviteLinkRequest -> 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 EditChatInviteLinkRequest where parseJSON :: Value -> Parser EditChatInviteLinkRequest
parseJSON = forall a (d :: Meta) (f :: * -> *).
(Generic a, GFromJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
Value -> Parser a
gparseJSON
type EditChatInviteLink = "editChatInviteLink"
:> ReqBody '[JSON] EditChatInviteLinkRequest
:> Post '[JSON] (Response ChatInviteLink)
editChatInviteLink :: EditChatInviteLinkRequest -> ClientM (Response ChatInviteLink)
editChatInviteLink :: EditChatInviteLinkRequest -> ClientM (Response ChatInviteLink)
editChatInviteLink = forall api.
HasClient ClientM api =>
Proxy api -> Client ClientM api
client (forall {k} (t :: k). Proxy t
Proxy @EditChatInviteLink)
makeDefault ''EditChatInviteLinkRequest