{-# 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.
EditChatInviteLinkRequest -> Rep EditChatInviteLinkRequest x)
-> (forall x.
Rep EditChatInviteLinkRequest x -> EditChatInviteLinkRequest)
-> Generic EditChatInviteLinkRequest
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
$cfrom :: forall x.
EditChatInviteLinkRequest -> Rep EditChatInviteLinkRequest x
from :: forall x.
EditChatInviteLinkRequest -> Rep EditChatInviteLinkRequest x
$cto :: forall x.
Rep EditChatInviteLinkRequest x -> EditChatInviteLinkRequest
to :: forall x.
Rep EditChatInviteLinkRequest x -> EditChatInviteLinkRequest
Generic
instance ToJSON EditChatInviteLinkRequest where toJSON :: EditChatInviteLinkRequest -> Value
toJSON = EditChatInviteLinkRequest -> Value
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 = Value -> Parser EditChatInviteLinkRequest
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 = Proxy EditChatInviteLink -> Client ClientM EditChatInviteLink
forall api.
HasClient ClientM api =>
Proxy api -> Client ClientM api
client (forall t. Proxy t
forall {k} (t :: k). Proxy t
Proxy @EditChatInviteLink)
makeDefault ''EditChatInviteLinkRequest